<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class lastNews extends CWidget
{

	public function run()
	{
		$criteria = new CDbCriteria();
		$criteria->limit = 3;
		$criteria->order = '"pageCreateDate" desc';
		$criteria->compare( '"pageType"', 'news' );
		$criteria->compare( '"pageActive"', 1 );
		$models = Page::model()->findAll( $criteria );
		$this->render( 'lastnews', array( 'models' => $models ) );
	}

}
